package com.example.administrator.yunniuusedcar.holder;

import android.content.Context;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.example.administrator.common.ui.BaseAdapterRV;
import com.example.administrator.common.ui.BaseHolderRV;
import com.example.administrator.yunniuusedcar.R;
import com.example.administrator.yunniuusedcar.adapter.Info02ActionAdapter;
import com.example.administrator.yunniuusedcar.adapter.MainInfoAdapter;
import com.example.administrator.yunniuusedcar.model.mode_benn.WZ_ArticleInfoBean;
import com.squareup.picasso.Picasso;

import java.util.List;

/**  活动资讯  文章详情
 * Created by USER2015 on 2017/12/17.
 */

public class Info02ActionInfolHolder extends BaseHolderRV<WZ_ArticleInfoBean> {

    private RelativeLayout LLActivityInformage;
    private ImageView ivInfomationPage;
    private View viewColor;
    private TextView tvInfomationTitle;
    private TextView tvInfomationTime;
    private TextView tvInfomationSoure;
    private TextView tvInfomationFrom;
    private RecyclerView recyclerView66;
    private MainInfoAdapter mainInfoAdapter;
    private RecyclerView recyclerView2_2;
    private Info02ActionAdapter info02ActionAdapter;

    /**
     * 构造方法
     *
     * @param context 上下文对象
     * @param parent  指RecyclerView控件
     * @param adapter 适配器
     *                ,@param layoutResId RecyclerView的一个item布局文件
     */
    public Info02ActionInfolHolder(Context context, ViewGroup parent, BaseAdapterRV<WZ_ArticleInfoBean> adapter) {
        super(context, parent, adapter, R.layout.item_recycleview);   //fragment_choosecar02_information
    }

    @Override
    public void onFindViews(View itemView) {
        recyclerView2_2 = (RecyclerView) itemView.findViewById(R.id.recycler_view666);
       // initFindViewBid();
    }


    @Override
    protected void onRefreshView(WZ_ArticleInfoBean bean1, int position) {
        bean  = (WZ_ArticleInfoBean)bean1;
        List<WZ_ArticleInfoBean.Data> data = (List<WZ_ArticleInfoBean.Data>) bean.data;   //????/

        recyclerView2_2 = itemView.findViewById(R.id.recycler_view66);
        recyclerView2_2.setLayoutManager(new LinearLayoutManager(context,RecyclerView.VERTICAL,false));
        //适配器

        info02ActionAdapter = new Info02ActionAdapter(context,data);
        recyclerView2_2.setAdapter(info02ActionAdapter);

//        recyclerView2_2 = new Info02ActionAdapter(context,null);
//        recyclerView2_2.setAdapter(mainInfoAdapter);



    }




}
